#ifndef __XWindow__h__included__
#define __XWindow__h__included__

#include "gui/WindowImpl.h"

#include <X11/Xlib.h>

#include <string>
using std::string;

namespace neiderra {

	namespace rendering {
		class Renderer;
	}
	using rendering::Renderer;

	namespace gui {
		
		class XWindowImpl: public GUIWindowImpl {
			public:
				XWindowImpl(Core*, const string& title, GUIWindow* container);
				virtual ~XWindowImpl();
				
				virtual void swapBuffers();
				
				virtual void setRenderer(Renderer*);
				
				virtual int ResponseEvent(XEvent&);
				
				virtual Window GetXID() {return _window;}
				virtual long getID() {return (long) _window;}
				
				unsigned getWidth();
				
				unsigned getHeight();
				
				virtual void show();
				
				virtual void update();	
			private:
				Display* _display;
				GC _gc;
				Window _window;
				string _title;
				Renderer* _renderer;
		};
		
	}
}

#endif
